home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / games / dcg408up.zip / ADDENDUM.TXT next >
Text File  |  1997-03-05  |  12KB  |  301 lines

  1. This file lists the SYNTAX of new or modified functions not documented
  2. in the DCGAMES 4.00 Script Reference Guide.
  3. -----------------------------------------------------------------------
  4. The LOADIBK function has been added to be able to load instrument
  5. banks (in Sound Blaster IBK format) from the scripts. Two instrument
  6. banks are provided: MT32.IBK and GMIDI.IBK. The default instrument
  7. bank is MT32. The GMIDI file contains the General MIDI standard 
  8. instruments. If you copy any of this files to DCMUSIC.IBK then it
  9. will be loaded automatically when the game driver starts as the 
  10. default instrument bank. This affects only MIDI music files.
  11.  
  12. Example:
  13.   loadibk( "GMIDI.IBK" );
  14.   music( "mymusic.mid" );
  15. -----------------------------------------------------------------------
  16. The VIEWPCX, VIEWGIF and VIEWFLI commands now support 2 new arguments.
  17. The FRAME argument centers the image inside the currently defined
  18. frame as set by SET_FRAME(). The PALETTE argument causes the image's
  19. palette to be loaded. The default is for the palette NOT to be loaded,
  20. using instead the current palette. In 4.07 the default was for the 
  21. palette to BE loaded.
  22.  
  23. Example:
  24.    VIEWPCX( FRAME, "myfile.pcx" );
  25.    VIEWGIF( "myimage.gif", PALETTE );
  26.    VIEWFLI( FRAME, "mymovie.fli", PALETTE );
  27. -----------------------------------------------------------------------
  28. The WAITCK() and TIMECK() functions will wait a specified amount of
  29. time. The parameter is in CLOCK TICKS. There are exactly 18.2 clock
  30. ticks in one second. 
  31.  
  32. Example:
  33.    ! Move the NPC 10 steps to the right, taking one step
  34.    ! roughly every quarter of a second (5 ticks).
  35.    for L0 = 1 to 10 do
  36.      npc.x = npc.x + 1;
  37.      timeck( 5 );
  38.    endfor;
  39. -----------------------------------------------------------------------
  40. The TIMER function will return the number of clock ticks since
  41. mid night. This can be used to track the passage of real time,
  42. but care must be taken when playing at mid night :)
  43.  
  44. Example:
  45.    ! Do some stuff for about 10 seconds (182 tics)
  46.    L30 = TIMER; ! Remember the time now..
  47.    while TIMER - L30 < 182 do
  48.      .. keep doing stuff ..
  49.    endwhile;
  50. -----------------------------------------------------------------------
  51. The FOREACH loop construct has been extended so that you can make
  52. a loop through all VISIBLE (on the screen) NPCs or OBJECTS. This 
  53. is very usefull for animation, since you only have to animate the
  54. visible NPCs!
  55.  
  56. Example:
  57.   foreach VISIBLE npc do
  58.     ...
  59.   endfor;
  60. -----------------------------------------------------------------------
  61.         READTEXT( block# [, line#] );
  62. or      READTEXT( "fname.txt" );
  63.  
  64. Where:
  65. block#  is the number of the text block (in TEXT.DTA) to read
  66. line#   is the optional line number (if not given, all 16 lines are read)
  67.  
  68. If "fname.txt" is specified, the given text file is read instead.
  69.  
  70. NEW FUNCTIONALITY: Starting with version 4.07, the READTEXT function
  71. will look for "DCTXTVHx.PCX" (where VHx is VHI, VH1, etc.). For full
  72. block reads (line# omitted), the text is displayed inside the image
  73. with 10 pixel margins. You can change the PCX image to anything you
  74. want. 
  75.  
  76. You may also specify line# = -1, which tells READTEXT that an image
  77. has already been displayed (through SET_FRAME + VIEWPCX), and that
  78. the text should be displayed inside that image, instead of DCTXTVHx.PCX).
  79.  
  80. Example:
  81.    ! Show a book's text inside a book picture...
  82.    setframe( "SPELBOOK.PCX", 35, 15, 15, 15 );
  83.    viewpcx( "SPELBOOK.PCX" );
  84.    readtext( object.text, -1 );
  85.  
  86.    ! Show a SIGN's text inside the standard PCX background
  87.    readtext( object.text );
  88. -----------------------------------------------------------------------
  89.         SAVEGIF( "FILENAME.GIF" );
  90.  
  91. Saves the current screen to "filename.gif". See SAVEPCX() for more
  92. details. See also VIEWGIF(), which is identical to VIEWPCX(), except
  93. is shows GIF images.
  94. -----------------------------------------------------------------------
  95. <ret> = MSGBOX( blk#, btn#, b1 [, b2 [, b3]], "message text" );
  96.  
  97. where:
  98. <ret>   is 0, 1 or 2 depending on which button is pressed
  99. blk#    is the block # from the DCSYSTEM.VHx tiles to display
  100. btn#    is the number of buttons to display (1, 2 or 3)
  101. b1      is the text for button 1
  102. b2      is the text for button 2
  103. b3      is the text for button 3
  104.  
  105. Example:
  106.  
  107.    if msgbox( QUESTION, 2, "Yes", "No", "Open it?" ) = 0 then
  108.      .. go ahead and open it..
  109.    endif;
  110.  
  111. -----------------------------------------------------------------------
  112.         PAINT( SMALL | LARGE | SCREEN | WINDOW );
  113.  
  114. The new parameters (SMALL and LARGE) switch between the small 
  115. screen mode (window on the left for the world and stats/menu
  116. area on the right) and full screen mode (no stats/menu area).
  117.  
  118. See also related function "SPLIT"
  119. -----------------------------------------------------------------------
  120. <ret> = SPLIT;
  121.  
  122. where:
  123. <ret>   is TRUE (non zero) if the game is currently in split mode (with
  124.         the stats/menu/inventory area visible on the right.
  125.  
  126. Example:
  127.  
  128.   L0 = SPLIT;                           ! Remember the current mode
  129.   paint( SMALL );                       ! Switch to small mode
  130.   ...                                   ! Do something in small mode
  131.   if not L0 then paint( LARGE ); endif; ! Restore old mode..
  132. -----------------------------------------------------------------------
  133. <ret> = LOS( <from>, <to> [, <tlist>] );
  134.  
  135. where:
  136. <ret>   is TRUE (non zero) if a path straight line path between
  137. -----------------------------------------------------------------------
  138. <ret> = LOS( <from>, <to> [, <tlist>] );
  139.  
  140. where:
  141. <ret>   is TRUE (non zero) if a path straight line path between
  142. -----------------------------------------------------------------------
  143. <ret> = LOS( <from>, <to> [, <tlist>] );
  144.  
  145. where:
  146. <ret>   is TRUE (non zero) if a path straight line path between
  147.         <from> and <to> contains only landscape tiles of the transparency
  148.         given in the (optional) <tlist>.
  149.  
  150. <from>  is an X/Y location, which can be NPC, PLAYER, OBJECT or two
  151.         numeric expressions. See examples.
  152.  
  153. <to>    is an X/Y location, which can be NPC, PLAYER, OBJECT or two
  154.         numeric expressions. See examples.
  155.  
  156. <tlist> is a comma separated list of one or more transparency values
  157.         to be checked.  The default is 0. Names for these values can
  158.         be found in [LAND TRANSPARENCY] in the DCCTOKEN.DAT file,
  159.         where CLEAR = 0 and SOLID = 1.  You can change this and create
  160.         different "levels" of transparency (say 0 to 3) and allow 
  161.         the player to "see" 0 to 2 during the day and 0 to 1 during 
  162.         the night, for example.
  163.  
  164. Examples:
  165.   The NPC animation routines use LOS to determine if the NPC can see
  166.   the player. If they can, they "walk" towards the player (only the
  167.   hostile NPCs do this).
  168.  
  169.     if LOS( npc, player ) then
  170.       <move the npc...>
  171.     endif;
  172.  
  173.  
  174. -----------------------------------------------------------------------
  175. <ret> = LOR( <from>, <to> [, <dlist>] );
  176.  
  177. where:
  178. <ret>   is TRUE (non zero) if a path straight line path between
  179.         <from> and <to> contains only landscape tiles of the DENSITY
  180.         given in the (optional) <dlist>.
  181.  
  182. <from>  is an X/Y location, which can be NPC, PLAYER, OBJECT or two
  183.         numeric expressions. See examples.
  184.  
  185. <to>    is an X/Y location, which can be NPC, PLAYER, OBJECT or two
  186.         numeric expressions. See examples.
  187.  
  188. <dlist> is a comma separated list of one or more density values to be
  189.         checked.  The default is 0. Names for these values can
  190.         be found in [WORLD DENSITY] in the DCCTOKEN.DAT file, where
  191.         FLAT = 0, ROUGH = 1, etc. Note that the default of 0 is not
  192.         very useful. Players and NPCs can walk on different terrains
  193.         depending on the type of vehicle or type of npc.  For example,
  194.         a Sea Dragon can walk on DEEP and ROUGH WATER.
  195.  
  196. Examples:
  197.     I didn't use LOR() in any of the examples so far. You might want
  198.     to make it so that an NPC doesn't start moving towards a player
  199.     unless they can SEE the player AND they can REACH the player:
  200.       if LOS( npc, player ) and LOR( npc, player, LAND, ROUGH ) then
  201.         <move the npc...>
  202.       endif;
  203.  
  204.     Note that the above example applies only to land based NPCs. For
  205.     Water based NPCs, it would be:
  206.       if LOS( npc, player ) and LOR( npc, player, DEEP_WATER, ROUGH_WATER ) then
  207.         <move the npc...>
  208.       endif;
  209.  
  210.     Here is an example using LOR to see if a player can REACH a certain
  211.     DOOR from where they are standing:
  212.  
  213.       if visible( world.doorx(1), world.doory(1) ) and
  214.          LOR( player, world.doorx(1), world.doory(1), FLAT, ROUGH ) then
  215.         <door is visible and player can reach it, so maybe take
  216.          control of the player and "walk" him over to that door..>
  217.         ..
  218.       endif;
  219.  
  220. -----------------------------------------------------------------------
  221. <svar> = SWRITE[LN]( ... );
  222.  
  223. Identical to a WRITE and WRITELN, except the value is written to the
  224. string variable instead of the text window.
  225.  
  226. -----------------------------------------------------------------------
  227. PWRITE[LN]( ... );
  228.  
  229. Identical to a WRITE and WRITELN, except the text is written to the
  230. text window formed within a PCX image file displayed using VIEWPCX()
  231. within the margins specified using SET_FRAME().
  232.  
  233. Example:
  234.    set_frame( "scroll.pcx", 30, 40, 30, 40, 0 );
  235.    viewpcx ( "scroll.pcx" );
  236.    pwrite( "Name: ", object.name );
  237.    write( "You see a ", object.class, " scroll." );
  238.  
  239. Note that PWRITE[LN] starts writting at the top of the image and
  240. scrolls down. If you want to clear the image and start writting 
  241. at the top again, you need to re-issue the set_frame() AND the
  242. viewpcx() calls.
  243.  
  244. -----------------------------------------------------------------------
  245. SET_FRAME( pcx, lft, top, rgt, bot, color );
  246.  
  247. Where:
  248.   pcx is a file containing a PCX image file.
  249.   lft is the margin from the left.
  250.   top is the margin from the top.
  251.   rgt is the margin on the right.
  252.   bot is the margin on the bottom.
  253.   color is the color to use for the text (default 0 = black).
  254.  
  255. ----------------------------------------------------------------------
  256. VOLUME( v1 [, v2 ] );
  257.  
  258. Sets the volume level. If only one volume is specified (v1), it is
  259. used for both left and right speakers. If the two are specified, then
  260. they are used for LEFT and RIGHT speakers respectively.
  261.  
  262. The value of V1 and V2 must be between 0 and 15. Note that 6 is barely
  263. audible while 15 is VERY LOUD!.  The default volume is 12.
  264. ---------------------------------------------------------
  265. Syntax     NEW( NPC|OBJECT, x, y, block# );
  266.  
  267. Purpose    Creates a new npc or object.
  268.  
  269. Parameters NPC or object to be made
  270.            X - x location
  271.            Y - y location
  272.            Block# - # of tile to be assigned to object/NPC
  273.  
  274. Remarks    None
  275.  
  276. Examples
  277.  
  278.   if group.y > 0 then
  279.     L0 = group.x;
  280.     L1 = group.y - 1;
  281.   elsif group.x > 0 then
  282.     L0 = group.x - 1;
  283.     L1 = group.y;
  284.   else
  285.     L0 = group.x + 1;
  286.     L1 = group.y + 1;
  287.   endif;
  288.   ! Create an NPC next to the player with a tile
  289.   ! selected at random between 30 and 37.
  290.   new(npc,L0,L1, 30 + random(8) );
  291.  
  292. See CONTROL.SCR for a more detailed example. The
  293. control script uses the DCWORLD defined defaults
  294. for statistics (DEFSTAT array) and tiles (DEFLANDBLK,
  295. DEFWATERBLK, DEFSPOOKBLK and DEFCAVEBLK) to set
  296. the NPC's statistics depending on size (small=0,
  297. medium=1, large=2, pirate boat=3) and the tiles.
  298. This logic starts with label :NEWMONSTER.
  299.  
  300.  
  301.